package net.ufrog.common.xls;

import net.ufrog.common.app.App;
import net.ufrog.common.exception.ServiceException;

/**
 * @author ultrafrog
 * @version 1.0, 2015-08-28
 * @since 1.0
 */
public class ExcelParseException extends ServiceException {

    private static final long serialVersionUID 	= 8067300330394761211L;
    private static final String DEFAULT_KEY		= "common.exception.excel.parse";

    /** 行号 */
    private Integer row;

    /** 列号 */
    private Integer cell;

    /**
     * 构造函数
     *
     * @param row 行号
     * @param cell 列号
     */
    public ExcelParseException(Integer row, Integer cell) {
        super("cannot parse xls by row: " + row + ", cell: " + cell, DEFAULT_KEY);
        this.row = row;
        this.cell = cell;
    }

    @Override
    public String getLocalizedMessage() {
        return App.message(getKey(), row, cell);
    }
}
